package utils;

public class Usefull
{
	public static Boolean BelongsToSection(Double x1, Double y1, Double x2,Double  y2, Double x3, Double y3)
	{
		Double det = x1*y2 + x2*y3+x3*y1 - x3*y2 - x2*y1 - x1*y3;
		if (det != 0)
			return false;
		else 
			{
				if ( ((Math.min(x1, x2) < x3) && (x3 < Math.max(x1,x2))) &&
						( (Math.min(y1, y2) < y3) && y3 <= (Math.max(y1, y2))))
					return true;
				else
					return false;
			}
			
		
	}
	
	public static Double DetM(Double x1, Double y1, Double x2,Double  y2, Double x3, Double y3)
	{
		Double det = x1*y2 + x2*y3+x3*y1 - x3*y2 - x2*y1 - x1*y3;
		return det;
	}
}
